import React from 'react'
import { Modal } from 'antd'
import style from './Modal.module.less'

function Main ({ visible, hide, data: d }) {
  if (!d) {
    return null
  }
  const { to_type: type, status } = d || {}
  return (
    <Modal
      open={visible}
      title='查看详情'
      width={600}
      onCancel={hide}
      footer={null}
      maskClosable={false}
      destroyOnClose
    >
      <div className={style['text-cell']}>送达类型：{type || '无'}</div>
      <div className={style['text-cell']}>是否为最后一个为人所知的地址：{d.islast_known_place === 1 ? '是' : '否'}</div>
      <div className={style['text-cell']}>送达情况：{status || '无'}</div>
      <div className={style['text-cell']}>仲裁地位：{d.action_subject || '无'}</div>
      <div className={style['text-cell']}>手机号码：{d.mobile || '无'}</div>
      <div className={style['text-cell']}>邮箱：{d.email || '无'}</div>
      <div className={style['text-cell']}>地址类型：{d.type || '无'}</div>
      <div className={style['text-cell']}>收件人：{d.contract || '无'}</div>
      <div className={style['text-cell']}>送达短信：{d.sms_content || '无'}</div>
      <div className={style['text-cell']}>送达邮件：{d.email_content || '无'}</div>
      <div className={style['text-cell']}>备注：{d.remark || '无'}</div>
    </Modal>
  )
}

export default Main
